<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <script>

        function Car(){
            this.color = 'red';
            this.doors = 4;
            this.mpg = 23;
            this.showColor = function(){
                alert(this.color);
            };
        }

        let c = new Car();
        with(c){
            //该代码块中默认c来调用
            console.log(color)
            showColor()
        }
    </script>

</head>

<body>

</body>
</html>
